package com.desksoft.ecommerce.util.html.element.format.dataformat;

import java.io.Serializable;

import org.dom4j.Element;

import com.desksoft.ecommerce.util.html.element.PageElement;

/**
 * 数据格式化
 * @author Administrator
 *
 */
public class DataFormat extends PageElement implements Serializable {

	protected String column;
	protected String code;
	protected String type;
	
	public DataFormat(Element element) {
		super();
		this.column = element.attributeValue("column");
		this.code = element.attributeValue("code");
		this.type = element.attributeValue("type");
	}

	@Override
	public String toHtml() {
		StringBuffer html = new StringBuffer();
		html.append("<span type='" + this.type + "' format='table' column='" + this.column + "' code='" + this.code + "' >");
		html.append(this.append());
		html.append("</span>");
		return html.toString();
	}
	
	/**
	 * 留给子类实现
	 */
	public String append(){
		return "";
	}

	public String getColumn() {
		return column;
	}

	public void setColumn(String column) {
		this.column = column;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}
